package org.example.controller.bank;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.example.common.JsonResult;
import org.example.controller.rep.BankQuesListRep;
import org.example.controller.rep.BankRatePageRep;
import org.example.controller.req.BankQuestionDetectionReq;
import org.example.controller.req.BankRateReq;
import org.example.service.bank.BankQuestionService;
import org.example.service.bank.BankRateService;
import org.example.service.utils.IConst;
import org.example.service.utils.PageUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

import static org.example.service.utils.IConst.API_BASE;

/**
 * @Author tql
 * @Desc 货币汇率 控制器
 * @Date 2024/2/26 14:36
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping(API_BASE + "bank/card")
@Api(tags = IConst.MODULE_BANK_DETECTION)
public class BankCardController {

    @Resource
    private BankQuestionService bankQuestionService;

    @GetMapping("/question/list")
    @ApiOperation(value = "银行卡问题列表查询", tags = IConst.MODULE_BANK_DETECTION)
    public JsonResult<List<BankQuesListRep>> questionList() {

        return JsonResult.ok(bankQuestionService.questionList());
    }

    @PostMapping("/question/detection")
    @ApiOperation(value = "银行卡问题检测", tags = IConst.MODULE_BANK_DETECTION)
    public JsonResult<Object> detection(@RequestBody BankQuestionDetectionReq bankQuestionDetectionReq) {
        bankQuestionService.detection(bankQuestionDetectionReq);
        return JsonResult.ok(true);
    }
}
